perm filename BOUND.CH[UHF,DEK] blob
sn#841748 filedate 1987-06-19 generic text, type T, neo UTF8
% change file to compute the error bounds and actual errors
@x
for l←start[k] to start[k+1]-1 do
begin u←i+del_i[l]; v←j+del_j[l];
buffer[u,v]←buffer[u,v]+err*alpha[l];
@y
if buffer[i,j]<min_d then
begin min_d←buffer[i,j]; write_ln(tty,min_d:10:5);
end
else if buffer[i,j]>max_d then
begin max_d←buffer[i,j]; write_ln(tty,max_d:10:5);
end;
if start[k]=start[k+1] then
begin tot_n←tot_n+1; tot_err←tot_err+abs(err);
if abs(err)>0.5 then tot_big←tot_big+1;
end
else for l←start[k] to start[k+1]-1 do
begin u←i+del_i[l]; v←j+del_j[l];
buffer[u,v]←buffer[u,v]+err*alpha[l];
if buffer[u,v]<min_d then
begin min_d←buffer[u,v]; write_ln(tty,min_d:10:5);
end
else if buffer[u,v]>max_d then
begin max_d←buffer[u,v]; write_ln(tty,max_d:10:5);
end;
@z
@x
@!alpha:array[0..256] of real; {constant of proportionality for diffusion}
@y
@!alpha:array[0..256] of real; {constant of proportionality for diffusion}
@!tot_err:real; {accumulated absolute value of errors}
@!tot_n,@!tot_big:integer; {number of barons and number of times |err>0.5|}
@!min_d,@!max_d:real; {min and max density so far}
@ @<Set init...@>= tot_err←0; tot_n←-63; tot_big←0; min_d←0.0; max_d←1.0;
@z
@x
@!hold:array[0..9,0..9] of boolean; {is this value too close to the bottom
of the buffer to allow immediate processing?}
@y
@!hold:array[0..9,0..9] of boolean; {is this value too close to the bottom
of the buffer to allow immediate processing?}
@!bound:array[0..63] of real; {max error input at this class}
@!total_err:real;
@z
@x
for j←0 to 9 do hold[9,j]←true;
@y
for j←0 to 9 do hold[9,j]←true;
for j←0 to 63 do bound[j]←0.0;
total_err←0.0;
@z
@x
if hold[i,j] then class_row[k]←i-8;
@y
if hold[i,j] then class_row[k]←i-8;
if bound[k]<0.5 then total_err←total_err+0.5-bound[k];
write_ln(tty,k:1,':',bound[k]:10:5,total_err:10:5);
if bound[k]<0.5 then bound[k]←0.5;
@z
@x
else alpha[ll]←1.0/w;
@y
else alpha[ll]←1.0/w;
u←i+del_i[ll]; v←j+del_j[ll]; u←class_number[u,v];
bound[u]←bound[u]+alpha[ll]*bound[k];
@z
@x
write_ln('\endddtone');
@y
write_ln('\endddtone');
write_ln(tty,tot_n:1,' barons; ',tot_big:1,' bigs; ',tot_err/tot_n:10:5);
@z